package com.dios.mirage.component.view;

import java.util.Vector;

import net.rim.device.api.system.Display;
import net.rim.device.api.system.EncodedImage;

import com.dios.mirage.component.fields.TurnImageField;

public class The360View extends View {

	public Vector listImage;
	private TurnImageField turnField;
	public int iImage = 0;
	public int imageSize = 22;

	private Vector loadResources(String type) {
		int width = Display.getWidth();
		Vector vector = new Vector();
		int j = 0;
		String path = "";
		for (int i = 0; i < imageSize; i++) {
			j = i + 1;
			path = type + "/(" + j + ")";
			vector.insertElementAt(getImage(path, width, new Double(width*5/8).intValue()), i);
		}
		return vector;
	}

	public void createGUI() {
		add(content);
		add(list);
		turnField = new TurnImageField(this);
		content.add(turnField);
	}

	public void setContent(String target, String text, String desc) {
		listImage = loadResources(target);
		turnField.setImage((EncodedImage) listImage.elementAt(iImage));
	}
}